import { createApp } from "vue";
import "./style.css";
import "./assets/globle.less"
import App from "./App.vue";

import VueAMap, {initAMapApiLoader} from '@vuemap/vue-amap';
// import VueAMapLoca from '@vuemap/vue-amap-loca';
// import VueAMapExtra from '@vuemap/vue-amap-extra';
import '@vuemap/vue-amap/dist/style.css'
import echarts from "@/utils/Echarts/echarts.js";
import { QuillEditor } from '@vueup/vue-quill'
import '@vueup/vue-quill/dist/vue-quill.snow.css';
import { createPinia } from 'pinia';
import LoginService from './utils/loginService';

// 仅在开发环境中使用模拟数据
if (process.env.NODE_ENV === 'development') {
  import('@/mock/mockApiService').then(({ setupMockApi }) => {
    setupMockApi();
    console.log('开发环境：已启用 API 模拟数据');
  });
}

initAMapApiLoader({
    key: '9d5096921b181cfceb45a84966116430',
    securityJsCode: 'c40297acf7138ca1057ad138012dd4c1', // 新版key需要配合安全密钥使用
    //Loca:{
    //  version: '2.0.0'
    //} // 如果需要使用loca组件库，需要加载Loca
})

const app = createApp(App);
const pinia = createPinia();

import router from "./router/index";

import ElementPlus from "element-plus";
import "element-plus/dist/index.css";

app.use(pinia);
app.use(router);
app.use(ElementPlus);
app.use(VueAMap);
app.use(LoginService);
app.config.globalProperties.$echarts = echarts;

app.mount("#app");
app.component('QuillEditor', QuillEditor)
